package com.maschinenstuermer.profiler.model.impl;

public enum TransactionStatus {
	ACTIVE,
	MARKED_ROLLBACK,
	PREPARED,
	COMMITED,
	ROLLEDBACK,
	UNKNOWN,
	NO_TRANSACTION,
	PREPARING,
	COMMITING,
	ROLLING_BACK;
	
	public static TransactionStatus valueOf(int status) {		
		switch (status) {
		case 0: return ACTIVE;
		case 1: return MARKED_ROLLBACK;
		case 2: return PREPARED;
		case 3: return COMMITED;
		case 4: return ROLLEDBACK;
		case 6: return NO_TRANSACTION;
		case 7: return PREPARING;
		case 8: return COMMITING;
		case 9: return ROLLING_BACK;
		default: return UNKNOWN;
		}
	}
}
